# include <bits/stdc++.h>
# define ll long long
using namespace std;
int n, l, r, t, h[100000], dp[100000];
inline int get_num() {
	int k = 0, f = 1;
	char c = getchar();
	for(; !isdigit(c); c = getchar());
	for(; isdigit(c); c = getchar()) k = k * 10 + c - '0';
	return k * f;
}
ll qia[20023];
inline void solve() {
	qia[1] = 1;
	for(int i = 1 + l; i <= n; i++) {
		qia[i] = qia[i - 1];
		if(h[i] == h[1]) {
			dp[i] = qia[i - l] - qia[(i - r - 1) >= 0 ? (i - r - 1) : 0];
			while(dp[i] >= 998244353) dp[i] -= 998244353;
			qia[i] += dp[i];
			while(qia[i] >= 998244353) qia[i] -= 998244353;
		}
	}
	printf("dp : ");
	for(int i = 1; i <= n; i++) {
		printf("%d ", dp[i]);
	}
	printf("\nqia : ");
	for(int i = 1; i <= n; i++) {
		printf("%lld ", qia[i]);
	}
	printf("\n%d", dp[n]);
}
int main() {
	freopen("in.txt", "r", stdin);
	//freopen("cirnoisclever.in", "r", stdin);
	//freopen("bl.out", "w", stdout);
	n = get_num();
	l = get_num();
	r = get_num();
	t = get_num();
	for(int i = 1; i <= n; i++) {
		h[i] = get_num();
	}
	dp[1] = 1;
	//if(!t) {
	//	solve();
	//	return 0;
	//}
	for(int i = 1; i + l <= n; i++) {
		for(int j = i + l; j <= i + r; j++) {
			if(abs(h[j] - h[i]) <= t)
			dp[j] += dp[i];
			if(dp[j] >= 998244353) dp[j] -= 998244353;
		}
	}
	printf("dp : ");
	for(int i = 1; i <= n; i++) {
		printf("%d ", dp[i]);
	}
	//for(int i = 1; i <= n; i++) {
	//	printf("%d\n", dp[i]);
	//}
	//printf("%d", dp[n]);
	return 0;
}
